#! python2
# -*- coding: utf-8 -*-

import pandas as pd
import numpy as np

# dates = pd.date_range('20171221', periods=6)
# # 正态分布就用randn
# df = pd.DataFrame(np.random.rand(6, 5), index=dates, columns=list('a1234'))
# print df
#
# list1 = pd.Series([1, 3, 5, np.nan, 6, 8])
# print list1
#
# # 字典转换对象
# dic = {'a': 1, 'b': 2, 'c': 3}
# obj = pd.Series(dic)
# print obj

print '##############二维数据##############'
df2 = pd.DataFrame(
    {'序号': 1.,
     'Date': pd.Timestamp('20171221'),
     'c': pd.Series(1, index=list(range(4)), dtype='float32'),
     'd': np.array([3] * 4, dtype='int32'),
     'E': pd.Categorical(['test', 'test1', 'test', 'test1']),
     'F': 'foo'
     }
)
print df2
print df2.dtypes  #dtype: object datetime64[ns]